package com.xianshijian.oauth.common.entity;

/**
 * OAuth2.0静态类
 * @author Administrator
 *
 */
public final class OAuth {

    public static final class HttpMethod {
        public static final String POST = "POST";
        public static final String GET = "GET";
        public static final String DELETE = "DELETE";
        public static final String PUT = "PUT";
    }

    public static final class HeaderType {
        public static final String CONTENT_TYPE = "Content-Type";
        public static final String WWW_AUTHENTICATE = "WWW-Authenticate";
        public static final String AUTHORIZATION = "Authorization";
    }

    public static final class WWWAuthHeader {
        public static final String REALM = "realm";
    }

    public static final class ContentType {
        public static final String URL_ENCODED = "application/x-www-form-urlencoded";
        public static final String JSON = "application/json";
    }
    
    /**
     * 状态码
     * @author Administrator
     *
     */
    public static final class StatusCode {
    	/**
    	 * 返回成功
    	 */
    	public static final int OK = 40000;
    	/**
    	 * 第三方ID错误
    	 */
        public static final int THIRD_PARTY_ID_ERROR = 40001;
        /**
         * 回调URL错误
         */
        public static final int REDIRECT_URL_ERROR = 40002;
        /**
         * scope错误
         */
        public static final int SCOPE_ERROR = 40003;
        /**
         * 客户端非法操作
         */
        public static final int CLIENT_OPR_ERROR = 40004;
        
        /**
         * state错误
         */
        public static final int STATE_ERROR = 40005;
        /**
         * code错误
         */
        public static final int CODE_ERROR = 40006;
        /**
         * state错误
         */
        public static final int SIGN_ERROR = 40007;
        /**
         * access_token错误
         */
        public static final int ACCESS_TOKEN_ERROR = 40008;
        /**
         * access_token已过期
         */
        public static final int ACCESS_TOKEN_EXPIRED = 40009;
        /**
         * 找不到信息
         */
        public static final int NOT_FOUND = 40010;
        /**
         * 服务端错误
         */
        public static final int SERVER_ERROR = 40011;
        
        
    }

//    public static final String OAUTH_RESPONSE_TYPE = "response_type";
    /**
     * 第三方ID
     */
    public static final String OAUTH_THIRD_PARTY_ID = "third_party_id";
    /**
     * 第三方secret
     */
    public static final String OAUTH_THIRD_PARTY_SECRET = "third_party_secret";
    /**
     * 标签：用于验证第三方传递的参数
     */
    public static final String OAUTH_SIGN = "sign";
    /**
     * 返回地址
     */
    public static final String OAUTH_REDIRECT_URL = "redirect_url";
    /**
     * 访问的资源类型：
     * 		/user时访问用户信息
     */
    public static final String OAUTH_SCOPE = "scope";
    /**
     * 戳：防攻击
     */
    public static final String OAUTH_STAMP = "stamp";
    /**
     * 16位随机数：用于加密密码
     */
    public static final String OAUTH_CHALLENGE = "challenge";
    
    /**
     * 用于防CRF攻击，原样返回给第三方
     */
    public static final String OAUTH_STATE = "state";

//    public static final String OAUTH_GRANT_TYPE = "grant_type";
    /**
     * 授权码
     */
    public static final String OAUTH_CODE = "code";
    /**
     * 访问令牌
     */
    public static final String OAUTH_ACCESS_TOKEN = "access_token";
    /**
     * access_token的过期时间
     */
    public static final String OAUTH_EXPIRES_IN = "expires_in";
//    public static final String OAUTH_REFRESH_TOKEN = "refresh_token";
    
//    public static final String OAUTH_TOKEN_TYPE = "token_type";
    /**
     * 兼客的sessionId
     */
    public static final String OAUTH_SESSION_ID = "sessionId_sjk";
}